#!/bin/bash
rm -rf *.o
rm -rf *.gch
rm -rf main

gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c xml_lib.c xml_lib.h  -I/usr/include/libxml2/
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c mysql_lib.c mysql_lib.h  -I/usr/local/mysql/include/mysql -DUNIV_LINUX
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c sdb_struct.h sdb_struct.c  
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c conf_lib.c conf_lib.h
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c memcache_lib.c memcache_lib.h
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c libevent_lib.c libevent_lib.h queue.h  -I/usr/local/include/
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c proc_data_lib.c proc_data_lib.h -I/usr/local/mysql/include/mysql -DUNIV_LINUX
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c socket_lib.c socket_lib.h
#gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c thread_lib.c thread_lib.h 
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c mem_lib.c mem_lib.h
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c time_lib.c time_lib.h
#gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c convey_lib.c convey_lib.h -I/usr/local/mysql/include/mysql -DUNIV_LINUX
#gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c record_lib.c record_lib.h -I/usr/local/mysql/include/mysql -DUNIV_LINUX


#gcc -g -o main main.c socket_lib.o conf_lib.o libevent_lib.o -levent

gcc -g -o main main.c socket_lib.o conf_lib.o memcache_lib.o libevent_lib.o mysql_lib.o   mem_lib.o time_lib.o  sdb_struct.o proc_data_lib.o  xml_lib.o   -lxml2  -rdynamic -L/usr/local/mysql/lib/mysql -lmysqlclient_r -lpthread -lz -lcrypt -lnsl -lm -levent

#gcc -g -o convey convey.c conf_lib.o sdb_struct.o socket_lib.o time_lib.o  convey_lib.o mysql_lib.o -rdynamic -L/usr/local/mysql/lib/mysql -lmysqlclient_r -lpthread -lz -lcrypt -lnsl -lm

